<script setup>
import Top from "@/views/Top.vue"
import {provide,ref} from "vue";

const refreshKey = ref(0);

// 定义刷新方法
const refresh = () => {
  refreshKey.value++;
};

// 使用 provide 提供刷新方法和数据
provide('refreshMethod', refresh);
provide('refreshKey', refreshKey);


</script>
<template>
  <div class="mains">
    <Top :key="refreshKey"/>
    <router-view v-slot="{ Component }">
      <component :is="Component" />
    </router-view>
  </div>
</template>

